import PacketConstants from './constants/PacketConstants'

export class LoginPackage {
    command = PacketConstants.LOGIN;
    constructor(user) {
        this.user = user;
    }
}

export class MessagePackage {
    command = PacketConstants.COMMAN_MSG;
    constructor(content, source, target) {
        this.content = content;
        this.source = source;
        this.target = target;
    }
}

export class OnlineQueryPackage {
    command = PacketConstants.ONLINE_QUERY;
}

export class Msg {
    type = "";
    content = "";
    source = "";
    target = "";

    constructor(type, content, source, target) {
        this.type = type;
        this.content = content;
        this.source = source;
        this.target = target;
        this.time = new Date().getTime();
    }
}